package blackitheima.Array;

import java.util.concurrent.ArrayBlockingQueue;
//吃货
public class Cooker extends Thread {
    private ArrayBlockingQueue<String> list;
    public Cooker(ArrayBlockingQueue<String> list) {
        this.list=list;
    }

    @Override
    public void run() {
        while (true) {
            try {
                list.put("汉堡包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("我放一个汉堡包");
        }
    }
}
